package com.example.serverdemo.serviceImpl;

import com.example.serverdemo.dto.CentralControllerProtocolDto;
import com.example.serverdemo.mapper.ProtocolContentMapper;
import com.example.serverdemo.mapper.ProtocolInfoMapper;
import com.example.serverdemo.service.ProtocolInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProtocolInfoServiceImpl implements ProtocolInfoService {

    @Autowired
    private ProtocolInfoMapper infoMapper;
    @Autowired
    private ProtocolContentMapper contentMapper;
    @Override
    public CentralControllerProtocolDto queryProtocolInfo(int protocolId) {
        CentralControllerProtocolDto protocol = new CentralControllerProtocolDto();
        protocol.setInfo(infoMapper.queryProtocolInfo(protocolId));
        protocol.setContents(contentMapper.queryProtocolContentByProtocolId(protocolId));
        return protocol;
    }
}
